import request from '@/config/axios'

// 阶段-轮次 VO
export interface StageRoundVO {
  id: string // 轮次ID
  roundName: string // 轮次名称
  isDebateRound: boolean // 是否是答辩轮
  roundNum: number // 轮次计数
  awardsId: string // 评奖ID
  instanceRuleId: string // 评奖阶段规则设置ID
  isOpenConfirm: boolean // 是否开启评委确认成绩
  remark: string // 备注
}

// 阶段-轮次 API
export const StageRoundApi = {
  // 查询阶段-轮次分页
  getStageRoundPage: async (params: any) => {
    return await request.get({ url: `/awards/stage-round/page`, params })
  },

  // 查询阶段-轮次详情
  getStageRound: async (id: string) => {
    return await request.get({ url: `/awards/stage-round/get?id=` + id })
  },

  // 新增阶段-轮次
  createStageRound: async (data: StageRoundVO) => {
    return await request.post({ url: `/awards/stage-round/create`, data })
  },

  // 修改阶段-轮次
  updateStageRound: async (data: StageRoundVO) => {
    return await request.put({ url: `/awards/stage-round/update`, data })
  },

  // 删除阶段-轮次
  deleteStageRound: async (id: string) => {
    return await request.delete({ url: `/awards/stage-round/delete?id=` + id })
  },

  // 导出阶段-轮次 Excel
  exportStageRound: async (params) => {
    return await request.download({ url: `/awards/stage-round/export-excel`, params })
  }
}
